******************************************************************************************************************************************
*MANUSCRIPT: Authorized Generic Entry prior to Patent Expiry: Reassessing Incentives for Independent Generic Entry 
*AUTHOR:     Silvia Appelt, University of Munich, silvia.appelt@lrz.uni-muenchen.de

******************************************************************************************************************************************
				        *** Extraction NPI data tables from SQL database: NPI DB07 (2001-2003/2004-2007) ***
						            		* Date last edit:  11 January 2015 * 
******************************************************************************************************************************************    
version 13.0
set more off
cap log close
clear

/*
For data inquiries, including database software, username and password, please contact:
INSIGHT Health GmbH & Co. KG
Auf der Lind 10
65529 Waldems-Esch
Tel.: 06126/955-0
Fax: 06126/955-20
E-Mail: info@insight-health.de
http://www.insight-health.de/ 
*/

odbc list
odbc query "NPI90DI", user(XXX) password(XXX)

odbc load,  table(abg) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table abg (DB07)"
save abg_db07.dta, replace
clear

odbc load,  table(atc1) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc1 (DB07)"
save atc1_db07.dta, replace
clear

odbc load,  table(atc2) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc2 (DB07)"
save atc2_db07.dta, replace
clear

odbc load,  table(atc3) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc3 (DB07)"
save atc3_db07.dta, replace
clear

odbc load,  table(atc4) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc4 (DB07)"
save atc4_db07.dta, replace
clear

odbc load,  table(DI_CODES) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_CODES (DB07)"
save DI_CODES_db07.dta, replace
clear

odbc load,  table(DI_COLUMNS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COLUMNS (DB07)"
save DI_COLUMNS_db07.dta, replace
clear


odbc load,  table(DI_COMB_BASE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COMB_BASE (DB07)"
save DI_COMB_BASE_db07.dta, replace
clear


odbc load,  table(DI_COMB_ELEMS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COMB_ELEMS (DB07)"
save DI_COMB_ELEMS_db07.dta, replace
clear

odbc load,  table(DI_FACTS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_FACTS (DB07)"
save DI_FACTS_db07.dta, replace
clear

odbc load,  table(DI_FUNCTIONS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_FUNCTIONS (DB07)"
save DI_FUNCTIONS_db07.dta, replace
clear


odbc load,  table(DI_GROUPS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GROUPS (DB07)"
save DI_GROUPS_db07.dta, replace
clear


odbc load,  table(DI_GRP_BASE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GRP_BASE (DB07)"
save DI_GRP_BASE_db07.dta, replace
clear


odbc load,  table(DI_GRP_ELEMS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GRP_ELEMS (DB07)"
save DI_GRP_ELEMS_db07.dta, replace
clear

odbc load,  table(DI_JOINS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_JOINS (DB07)"
save DI_JOINS_db07.dta, replace
clear


odbc load,  table(DI_ONE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_ONE (DB07)"
save DI_ONE_db07.dta, replace
clear


odbc load,  table(DI_QDEF_TOPICS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_QDEF_TOPICS (DB07)"
save DI_QDEF_TOPICS_db07.dta, replace
clear

odbc load,  table(DI_TOPICS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_TOPICS (DB07)"
save DI_TOPICS_db07.dta, replace
clear

odbc load,  table(einf) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table einf(DB07)"
save einf_db07.dta, replace
clear


odbc load,  table(fbetrag) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table fbetrag (DB07)"
save fbetrag_db07.dta, replace
clear

odbc load,  table(gen) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table gen(DB07)"
save gen_db07.dta, replace
clear

odbc load,  table(hafo) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hafo (DB07)"
save hafo_db07.dta, replace
clear

odbc load,  table(hst) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hst(DB07)"
save hst_db07.dta, replace
clear

odbc load,  table(hst_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hst_hist (DB07)"
save hst_hist_db07.dta, replace
clear

odbc load,  table(jahr) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table jahr(DB07)"
save jahr_db07.dta, replace
clear

odbc load,  table(jahr_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table jahr_hist (DB07)"
save jahr_hist_db07.dta, replace
clear

odbc load,  table(konz) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table konz (DB07)"
save konz_db07.dta, replace
clear

odbc load,  table(mat) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table mat (DB07)"
save mat_db07.dta, replace
clear

odbc load,  table(monat) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table monat (DB07)"
save monat_db07.dta, replace
clear

odbc load,  table(nfc1) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc1 (DB07)"
save nfc1_db07.dta, replace
clear


odbc load,  table(nfc2) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc2 (DB07)"
save nfc2_db07.dta, replace
clear


odbc load,  table(nfc3) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc3 (DB07)"
save nfc3_db07.dta, replace
clear

odbc load,  table(nnn) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nnn (DB07)"
save nnn_db07.dta, replace
clear

odbc load,  table(npi) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table npi (DB07)"
save npi_db07.dta, replace
clear

odbc load,  table(pck) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table pck (DB07)"
save pck_db07.dta, replace
clear

odbc load,  table(prd) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table prd (DB07)"
save prd_db07.dta, replace
clear

odbc load,  table(prdo) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table prdo (DB07)"
save prdo_db07.dta, replace
clear

odbc load,  table(pzn) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table pzn (DB07)"
save pzn_db07.dta, replace
clear

odbc load,  table(quartal) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table quartal (DB07)"
save quartal_db07.dta, replace
clear

odbc load,  table(str) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table str (DB07)"
save str_db07.dta, replace
clear

odbc load,  table(sub) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table sub (DB07)"
save sub_db07.dta, replace
clear

odbc load,  table(val) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val (DB07)"
save val_db07.dta, replace
clear

odbc load,  table(val_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val_hist (DB07)"
save val_hist_db07.dta, replace
clear

odbc load,  table(val_hst_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val_hst_hist (DB07)"
save val_hst_hist_db07.dta, replace
clear

odbc load,  table(ytd) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table ytd (DB07)"
save ytd_db07.dta, replace
clear

odbc load,  table(zklass) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table zklass (DB07)"
save zklass_db07.dta, replace
clear


odbc load,  table(zzb) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table zzb (DB07)"
save zzb_db07.dta, replace
clear



*** end of do file




